@primary: #1EB7D8;
@secondary: #D4E9FC;
@accent: #F0F9FF;
@dark: #169DBD;
@error: #FF6B6B;

// 动画定义
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.login-page {
  min-height: 100vh;
  background-color: @accent;
  background-image: 
    radial-gradient(@primary 0.3px, transparent 0.3px),
    radial-gradient(@primary 0.3px, @accent 0.3px);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  background-attachment: fixed;
  font-family: 'Comic Sans MS', 'Marker Felt', 'Arial Rounded MT Bold', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

// 装饰元素
.decoration {
  position: absolute;
  background-color: @secondary;
  border-radius: 50%;
  opacity: 0.5;
  animation: float 6s ease-in-out infinite;
  
  &.dot-1 {
    top: 40px;
    left: 20px;
    width: 64px;
    height: 64px;
    animation-delay: 0s;
  }
  
  &.dot-2 {
    bottom: 80px;
    right: 32px;
    width: 48px;
    height: 48px;
    animation-delay: 1s;
  }
  
  &.dot-3 {
    top: 33%;
    right: 40px;
    width: 40px;
    height: 40px;
    animation-delay: 0.5s;
  }
}

// 主容器
.login-container {
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 10;
}

// 品牌区域
.brand-section {
  text-align: center;
  margin-bottom: 40px;
  
  .logo {
    width: 80px;
    height: 80px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    animation: float 6s ease-in-out infinite;
    
    .logo-icon {
      font-size: 32px;
      color: @primary;
    }
  }
  
  .brand-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: bold;
    color: @primary;
    margin-bottom: 8px;
  }
  
  .brand-subtitle {
    color: #666;
    margin: 0;
  }
}

// 登录表单区域
.login-form-section {
  backdrop-filter: blur(4px);
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  
  .form-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 24px;
    text-align: center;
  }
}

// 表单样式
.login-form {
  .form-item {
    margin-bottom: 20px;
    
    &.error {
      .input-container {
        .login-input {
          border-color: @error;
          animation: shake 0.5s ease-in-out;
        }
      }
    }
    
    .adm-form-item-feedback-error {
      opacity: 0;
      height: 0;
      overflow: hidden;
      transition: all 0.3s ease;
      display: flex;
      align-items: center;
      color: @error;
      font-size: 14px;
      margin-top: 4px;
    }
    
    &.adm-form-item-has-error {
      .adm-form-item-feedback-error {
        opacity: 1;
        height: auto;
      }
    }
  }
  
  .input-container {
    position: relative;
    
    .input-icon {
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: @primary;
      z-index: 2;
    }
    
    .login-input {
      width: 100%;
      padding-left: 40px;
      padding-right: 40px;
      height: 48px;
      border-radius: 16px;
      border: 1px solid #d9d9d9;
      background-color: rgba(255, 255, 255, 0.85);
      transition: all 0.3s ease;
      font-size: 16px;
      
      &:focus {
        border-color: @primary;
        box-shadow: 0 0 0 4px rgba(30, 183, 216, 0.15);
        outline: none;
        background-color: white;
      }
    }
    
    .password-toggle {
      position: absolute;
      right: 12px;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      color: #999;
      cursor: pointer;
      z-index: 2;
      padding: 4px;
      
      &:hover {
        color: @primary;
      }
    }
  }
  
  .login-button {
    width: 100%;
    height: 48px;
    background-color: @primary;
    color: white;
    font-weight: bold;
    border-radius: 16px;
    border: none;
    font-size: 16px;
    transition: background-color 0.3s;
    animation: pulse 3s infinite;
    
    &:hover {
      background-color: @dark;
    }
    
    &:active {
      background-color: @dark;
    }
    
    &.adm-button-loading {
      animation: none;
    }
  }
}

// 注册提示
.register-tip {
  text-align: center;
  margin-top: 24px;
  
  .tip-text {
    color: #666;
    font-size: 14px;
    margin: 0;
  }
  
  .contact-text {
    color: @primary;
    font-weight: 500;
    margin: 4px 0 0 0;
  }
}
// .register-button {
//   margin-top: 16px;
//   width: 100%;
//   height: 48px;
//   background-color: rgba(30, 183, 216, 0.1);
//   color: @primary;
//   font-weight: bold;
//   border-radius: 16px;
//   border: 2px solid rgba(30, 183, 216, 0.2);
//   font-size: 16px;
//   transition: background-color 0.3s;
//   animation: pulse 3s infinite;
// }

// 底部提示
.footer-tip {
  margin-top: 32px;
  text-align: center;
  
  .tip-content {
    color: #888;
    font-size: 12px;
    margin: 0;
  }
}

// 自定义Toast
.custom-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translate(-50%, -100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  z-index: 1000;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 80%;
  
  &.show {
    transform: translate(-50%, 0);
    opacity: 1;
  }
  
  .toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    
    &.success {
      background-color: rgba(34, 197, 94, 0.1);
      color: #22c55e;
    }
    
    &.error {
      background-color: rgba(239, 68, 68, 0.1);
      color: #ef4444;
    }
  }
  
  .toast-message {
    color: #333;
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
  }
}

// 响应式设计
@media (max-width: 768px) {
  .decoration {
    display: none;
  }
  
  .login-form-section {
    padding: 24px;
  }
  
  .brand-section .logo {
    width: 60px;
    height: 60px;
    
    .logo-icon {
      font-size: 24px;
    }
  }
}

// 覆盖Antd Mobile默认样式
:global {
  .adm-input {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
  }
  
  .adm-form-item {
    --border-inner: 0 !important;
  }
}